package h2UDPtest;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;

public class Send {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds=new DatagramSocket();

        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String line;
        while((line=br.readLine())!=null)
        {
            if("886".equals(line))
            {
                break;
            }

            byte []bys=line.getBytes(StandardCharsets.UTF_8);
            DatagramPacket dp=new DatagramPacket(bys,bys.length, InetAddress.getByName("127.0.0.1"),10086);
            ds.send(dp);
        }
    }
}
